#include "tbullet.h"

TBullet::TBullet():
        TObject(new TGraphic(this,true))
{
    getGraphic()->bindImageWithState(0,":/apple/red");
    _type = 'b';
    _size.x(50);
    _size.y(50);
}

void TBullet::move(){
    switch(this->getState()){
    case UP:
        _velocity.x(0);
        _velocity.y(-10);
        break;
    case DOWN:
        _velocity.x(0);
        _velocity.y(10);
        break;
    case RIGHT:
        _velocity.x(10);
        _velocity.y(0);
        break;
    case LEFT:
        _velocity.x(-10);
        _velocity.y(0);
        break;
    }

    _position += _velocity;
}
